<template>
  <div id="page">
    <!-- 顶部 -->
    <div id="header_top">
      <p class="iconfont">&#xe6bc;</p>
      <p class="text1">地址管理</p>
    </div>
    
    <v-list  @add1="add1" @bianji="bianji" v-show="istrue==true"></v-list>
    <v-path ref="aa" @add="add"  v-show='istrue==false' ></v-path>

  </div>
</template>

<script>


import vPath from './addpath.vue'
import vList from './listpath.vue'
import {  mapActions,mapGetters } from "vuex";
export default {
  data() {
    return {
      istrue: true,
      chosenAddressId: "1",
      list: [],
    };
  },
  components:{
    vPath,
    vList
  },

  methods: {
    ...mapActions({
      reqchangelist:'path/reqchangelist'
    }),
    add() {
      this.istrue = true;
      this.reqchangelist(this.userlist.uid)
    },
    // list点击了添加
    add1(){
      this.istrue = false;
    },
    // list点击编辑
    bianji(id){
      // console.log(id);
      this.istrue = false;
      // console.log(this.$refs.aa.);
      // console.log(this.userlist.uid);
      this.$refs.aa.getinfo(id,this.userlist.uid)
    }
  },
  mounted() {

  },
  computed:{
    ...mapGetters({
      userlist:"user",      
    })
  }
    
};
</script>

<style scoped src='../../assets/css/path.css'>
</style>
